class Student {
    private int id = 0;
    private String name = new String();
    private short age = 0;
    private char sex = 'F';

    Student() {}

    Student(int id) {
        this(id, new String(), (short)0, 'F');
    }

    Student(int id, String name) {
        this(id, name, (short)0, 'F');
    }

    Student(int id, String name, short age) {
        this(id, name, age, 'F');
    }

    Student(int id, String name, short age, char sex) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.sex = sex;
    }

    Student set(String name) {
        this.name = name;
        return this;
    }

    Student set(int id) {
        if (id > 100 && id < 1000)
            this.id = id;
        return this;
    }

    Student set(short age) {
        this.age = age;
        return this;
    }

    Student set(char sex) {
        this.sex = sex;
        return this;
    }

    Student init(int id, String name, short age, char sex) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.sex = sex;

        return this;
    }

    Student show() {
        System.out.printf("this.name = %s\n", name);
        System.out.printf("id = %d, name = %s, age = %d, sex = %c\n",
                            id, name, age, sex);
        return this;
    }
}


public class classTest {

    static public Student test(Student n) {
        System.out.printf("test: ");
        n.show().set('T');
        return n;
        // return new Student(666, "李四");
    }

    static public void main(String [] args) {
        // int a [] = new int[];
        // Student a = new Student();

        Student a = new Student(12, "张三", (short)35, 'M');
        // int a [] = {11, 22, 33, 44};

        test(a).set(130).show();

        // Student b = new Student();

        // a.id = 120;
        // a.name = "张三";
        // a.age = 23;
        // a.sex = 'A';

        // a.init(12, "张三", (short)23, 'A').set(10).show();

        // b.init(13, "张四", (short)25, 'b').show();
    }
}
